import mongoose from 'mongoose'

// 采购录入表模型
const schema = new mongoose.Schema({
    // 名称
    name: {
      type: String,
      required: true,
      unique: false
    },
    // 联系人
    saleUser: {
      type: String,
      required: true,
      unique: false
    },
    // 供应商
    region: {
      type: String,
      required: true,
      unique: false
    },
    // 单位
    unit: {
      type: String,
      required: true,
      unique: false
    },
    // 型号
    type: {
      type: String,
      required: true,
      unique: false
    },
    // 单价
    price: {
      type: Number,
      required: true,
      unique: false
    },
    // 数量
    count: {
      type: Number,
      required: true,
      unique: false
    },
    // 总价
    totalPrice: {
      type: Number,
      required: true,
      unique: false
    },
    // 备注
    remarks: {
      type: String,
      required: true,
      unique: false
    }
}, {
    // 日期
    timestamps: {
        createdAt: 'createTime',
        updatedAt: 'updateTime'
    }
})

export default mongoose.model('procure', schema)